import request from '@/utils/request'

// 创建订单
export function createOrder(data) {
  return request({
    url: '/user/order/create',
    method: 'post',
    data: data
  })
}

// 获取订单列表
export function listOrder(query) {
  return request({
    url: '/user/order/list',
    method: 'get',
    params: query
  })
}

// 获取订单详情
export function getOrder(orderId) {
  return request({
    url: `/user/order/${orderId}`,
    method: 'get'
  })
}

// 取消订单
export function cancelOrder(orderId) {
  return request({
    url: `/user/order/cancel/${orderId}`,
    method: 'put'
  })
}

// 确认收货
export function confirmOrder(orderId) {
  return request({
    url: `/user/order/confirm/${orderId}`,
    method: 'put'
  })
} 